home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HPAVC
/
HPAVC CD-ROM.iso
/
FNTPAK32.ZIP
/
BASIC.EXE
/
DEMOFNT2.BAS
< prev
next >
Wrap
BASIC Source File
|
1995-08-16
|
3KB
|
84 lines
DEFINT A-Z
'$INCLUDE: 'Font_Pak.Inc' '... For QB/PDS/VB-DOS
'======================================================== PowerBasic Users
''$INCLUDE "Font_Pak.Inc" '... PB users, UN-REM these lines
''$Link "ONDISK.PBU" '... Compile Ondisk.Bas if needed
''$Link "FontPakP.OBJ" '... SHAREWARE users
''$Link "Video.OBJ" '... REGISTERED users
''$Link "Fonts.OBJ" '... REGISTERED users
'======================================================== PowerBasic Users
'============================================================ DemoFnt2.Bas
'
' A Font Pak Demonstration Copyright 1991-1994 Rob W. Smetana
'
' Demonstrates how to load Font Pak fonts from disk. Note how simple it is!
'
' Requires: - A valid Font Pak font file. See "FontFile$ =..." below.
'
' - One of our OnDisk_? modules.
'
' - Font_Pak.Lib (Microsoft BASICs) or Font_Pak.Pbl (PowerBasic)
'
' Note how we check error codes below. You SHOULD use a File Exist
' function before you try to load fonts from disk. This helps ensure
' that an open drive door (which we can't trap for you) doesn't bring
' your program to its knees.
'============================================================ DemoFnt2.Bas
SCREEN 0, 0 '...Useful to ensure QB/QBX/VBDOS restore default
COLOR 7, 1: CLS
CALL fpInitialize: CLS '=== SHAREWARE versions ONLY
FontFile$ = "BigSanSr.F16"
Block = 1 '...load font into block 1; leave default font intact!
ErrorCode = LoadFontFile(FontFile$, Block%)
IF ErrorCode THEN
CLS
PRINT "Sorry, error "; ErrorCode; "occurred. Check source code to interpret this."
d$ = INPUT$(1)
END
'Possible Error Codes:
' -99 file's signature <> "FONT-P~F" (could mean file didn't exist)
' -88 Size of file < 1 (it had no font bitmap data; re-save font)
' -77 FirstChar + NumberChars > 256 (error in font file; re-save it)
' -66 Too little memory to allocate buffer and read font data
END IF
FILES "*.*" '...put something on the screen
COLOR 0, 7
LOCATE 25, 23: PRINT " Here's your NORMAL font. Press a key.";
d$ = INPUT$(1)
CALL rsWhichFonts(Block, Block) '...select block 1 exclusively
LOCATE 25, 23: PRINT " Here's your CUSTOM font. Press a key.";
d$ = INPUT$(1)
CALL rsWhichFonts(0, 0) '...restore default in block 0
LOCATE 25, 21: PRINT " And back to your NORMAL font. Press a key.";
d$ = INPUT$(1)
COLOR 7, 0
END